package com.yuxi.excelEntity;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yuxi.Entity.UserTaskCompletion;

public class ExportRsRj {
	private String prisonName="";
	private Integer id=0;
	private String infoContext;
	private String metrue;
	private String taskFinsh;
	private String comment;
	private Integer portId;
	public String getPrisonName() {
		return prisonName;
	}
	public void setPrisonName(String prisonName) {
		this.prisonName = prisonName;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getInfoContext() {
		return infoContext;
	}
	public void setInfoContext(String infoContext) {
		this.infoContext = infoContext;
	}
	public String getMetrue() {
		return metrue;
	}
	public void setMetrue(String metrue) {
		this.metrue = metrue;
	}
	public String getTaskFinsh() {
		return taskFinsh;
	}
	public void setTaskFinsh(String taskFinsh) {
		this.taskFinsh = taskFinsh;
	}
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
	public ExportRsRj(String prisonName, String infoContext, String metrue, String taskFinsh, String comment) {
		super();
		this.prisonName = prisonName;
		this.infoContext = infoContext;
		this.metrue = metrue;		
		List<UserTaskCompletion> list=new Gson().fromJson(taskFinsh, new TypeToken<List<UserTaskCompletion>>(){}.getType());
		if(list!=null){
			for(int i=0;i<list.size();i++){
				UserTaskCompletion u=list.get(i);
				SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
				String dat1 = sdf1.format(new Date(Long.parseLong(u.getTime())));				
				this.taskFinsh+=dat1+":"+u.getName()+":"+u.getText();				
			}	
		}	
		
		this.comment = comment;
	}
	
	public ExportRsRj() {
		super();
	}
	@Override
	public String toString() {
		return "ExportRsRj [prisonName=" + prisonName + ", id=" + id + ", infoContext=" + infoContext + ", metrue="
				+ metrue + ", taskFinsh=" + taskFinsh + ", comment=" + comment + "]";
	}
	
}
